import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path:"/",
    redirect:"/login"
  },  
  {
    path: "/index",
    name: "Home",
    component: () =>import("../views/index.vue"),
    children:[
      {
        path: "/home",
        name: "Home",
        component: () =>import("../views/home/index.vue"),
        
      },
      {
        path: "/bloa",
        name: "Bloa",
        component: () =>import("../views/bloa/index.vue"),
        meta:{
          title:"文章管理"
        }
      },
      {
        path: "/cation",
        name: "cation",
        component: () =>import("../views/cation/index.vue"),
        meta:{
          title:"分类管理"
        }
      },
      {
        path: "/label",
        name: "label",
        component: () =>import("../views/label/index.vue"),
        meta:{
          title:"标签管理"
        }
      },
      {
        path: "/sement",
        name: "sement",
        component: () =>import("../views/sement/index.vue"),
        meta:{
          title:"广告管理"
        }
      },
      {
        path: "/user",
        name: "user",
        component: () =>import("../views/user/index.vue"),
        meta:{
          title:"用户管理"
        }
      },
      {
        path: "/role",
        name: "role",
        component: () =>import("../views/role/index.vue"),
        meta:{
          title:"角色管理"
        }
      },
      {
        path: "/menu",
        name: "menu",
        component: () =>import("../views/menu/index.vue"),
        meta:{
          title:"用户管理"
        }
      },
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () =>import("../views/login/index.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
